//
//  MineCellTableViewCell.m
//  MJApp
//
//  Created by scjh on 15/3/27.
//  Copyright (c) 2015年 wangliang. All rights reserved.
//

#import "MineCellTableViewCell.h"

@interface MineCellTableViewCell ()
@property (weak, nonatomic) IBOutlet UIImageView *imageV;
@property (weak, nonatomic) IBOutlet UILabel *nameLabel;
@property (weak, nonatomic) IBOutlet UILabel *numLabel;

@end

@implementation MineCellTableViewCell

+ (instancetype)initWithTableView:(UITableView *)tableView {
    
    static NSString *cellID = @"MineCellTableViewCell";
    MineCellTableViewCell *cell = [tableView dequeueReusableCellWithIdentifier:cellID];
    if (cell == nil) {
        
        cell =  WL_XIB(@"MineCellTableViewCell");
        
        cell.selectionStyle = UITableViewCellSelectionStyleNone;
    }
    cell.cellHigh = CGRectGetHeight(cell.frame);
    return cell;
    
}

- (void)setInfoDic:(NSDictionary *)infoDic {
    
    _infoDic = infoDic;
    self.imageV.image = LOAD_IMAGE(infoDic[@"imagestr"]);
    self.nameLabel.text = infoDic[@"name"];
    NSInteger num = [infoDic[@"num"] integerValue];
    if (num > 0) {
        
        self.numLabel.text = [NSString stringWithFormat:@"  %@  ",infoDic[@"num"]];
    }else {
        
        self.numLabel.hidden = YES;
    }
}

- (void)awakeFromNib {
    // Initialization code
    self.numLabel.layer.cornerRadius = CGRectGetHeight(self.numLabel.frame) / 2;
    self.numLabel.clipsToBounds = YES;
}

- (void)setSelected:(BOOL)selected animated:(BOOL)animated {
    [super setSelected:selected animated:animated];

    // Configure the view for the selected state
}

@end
